package com.study.config;

import com.querydsl.jpa.impl.JPAQueryFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.persistence.EntityManager;

/**
 * @Classname JPAconfig
 * @Version 1.0.0
 * @Date 2022/4/6 17:06
 * @Created by yd
 */
@Configuration
public class JPAconfig {
	//让Spring管理JPAQueryFactory
	@Bean
	public JPAQueryFactory jpaQueryFactory(EntityManager entityManager) {
		return new JPAQueryFactory(entityManager);
	}
}
